package cn.tworice.cryption.service.impl;

import cn.tworice.cryption.service.CryptService;
import cn.tworice.cryption.util.AESUtils;

/**
 * AES加密实现
 */
public class AesServiceImpl implements CryptService {

    private final String key;

    public AesServiceImpl(String key) {
        this.key = key;
    }

    @Override
    public String encrypt(String input) {
        return AESUtils.encrypt(input, key);
    }

    @Override
    public String decrypt(String input) {
        return AESUtils.decrypt(input, key);
    }
}
